﻿using MaxStoreErp.Core.Interfaces;
using MaxStoreShop.Core.EditorBase;
using MaxStoreShop.Domain.Directories;
using MaxStoreShop.Logic.ServicesContracts.Directories;
using Microsoft.Practices.Unity;

namespace MaxStoreShop.WarehouseModule.ProductCategories.ProductCategoryEditor
{
    class ProductCategoryEditorPresenter : EditorPresenterBase<ProductCategoryEditorView, ProductCategoryEditorViewModel, ProductCategory>
    {
        [Dependency]
        public IProductCategoryService ProductCategoryService { get; set; }

        protected override void OnSave()
        {
            base.OnSave();
            ProductCategoryService.SaveProductCategory(ViewModel.SelectedItem);
            Container.Resolve<IDocumentManager>().Back();
        }
    }
}
